package com.MarkToTop.main;


import com.MarkToTop.util.Constant;
import com.MarkToTop.util.GameUtil;

import java.awt.*;
import java.awt.image.BufferedImage;

/**
 * MarkWang 版权所有 © Copyright 2020
 *
 * @CreateDate: Created in 2020-06-23 14:18
 * @Author: MarkToTop -(づ｡◕‿‿◕｡)づ
 * @Description:   游戏准备的相关内容
 */
public class GameReady {

    private BufferedImage titleIMG;
    private BufferedImage noticeIMG;

    private  int flash;

    public GameReady(){
        titleIMG = GameUtil.loadBufferedImage(Constant.TITLE_IMG_PATH);
        noticeIMG = GameUtil.loadBufferedImage(Constant.NOTICE_IMG_PATH);
    }
    public void draw(Graphics g){
        int x = Constant.Frame_Width - titleIMG.getWidth() >>1;
        int y = Constant.Frame_Height /3;
        g.drawImage(titleIMG,x,y,null);

        if(flash++ >8){
            x = Constant.Frame_Width - noticeIMG.getWidth() >> 1;
            y = Constant.Frame_Height /3 << 1;
            g.drawImage(noticeIMG,x,y,null);
            if(flash == 15){
                flash = 0;
            }
        }

    }
}
